This repository contains the simulation data and codes used to produce the main results presented in the manuscript submitted to Science with title: "Dating the Solar System's giant planet orbital instability using enstatite meteorites"
by Avdellidou (c.avdellidou@leicester.ac.uk), Delbo (delbo@oca.eu), Nesvorny (davidn@boulder.swri.edu), Walsh (kwalsh@boulder.swri.edu), and Morbidelli (morby@oca.eu)

######################################################
######################################################
###############Dynamical modelling####################

Dynamical modelling was performed using:
-SyMBA that is published in Duncan, Levison, and Lee, The Astronomical Journal 116, 2067 (1998).
-SWIFT_RMVS3 that is published in Levison and Duncan, Icarus 108, Issue 1, p. 18-36 (1994) and is available from Hal Levison's webpage at https://www.boulder.swri.edu/~hal/swift.html
-SyMBA (modified version) is available in 'swift_symba7_hybridgr_wrap.f'

Input files are:
- Case 1 of the giant planet instability is published in D. Nesvorny, D. Vokrouhlicky, A. Morbidelli, The Astrophysical Journal 768, 45 (2013). These data are included in 'Case_1.zip'.
- Simulation N35 is published in D. Nesvorny, F. V. Roig, R. Deienno, The Astronomical Journal 161, 50 (2021). These data are included in 'Simulation_N35.zip'.

- 'capture-results/currentGP/OnlyTheia/onlyTheia.tar' used as input to produce the data in Fig.2 (B)
- 'capture-results/currentGP/TPandTheia/TPandTheia.tar' used as input to produce the data in Fig.2 (C)
- 'capture-results/instability/instability.tar' used as input to produce the data in Fig.3

Figures:
- Fig.2(A) is produced by: 'currentPlanetOrb.py'
Data are included in: 'currentGP-TSD/**/*.osc'

- Fig.2(B) and (C) is produced by: 'currentGP-theia.py'
Data are included in: 'capture-results/currentGP/OnlyTheia/" and 'capture-results/currentGP/TPandTheia/' respectively.

- Fig.2(D) is produced by: 'preGPIorb.py'
Data are included in: 'pre-instGP-TSD/**/*.osc'

- Fig.3 is produced by: 'gpi.py'
Data are included in: 'capture-results/instability/*.osc'

- FigS2 is produced by: 'sd_time.py'
Data are included in: 'SDvsTime/currentGP' and 'SDvsTime/instability'

- Estimation of the implanted planetesimals is performed using: 'numberImplantedV2.py'

######################################################
######################################################
###################Thermal modelling##################
Thermal Model:
- The thermal model is done with the code 'diffHeatV7.py' 
Results for the different times are included in: 'thermal_model/eltemp-*.dat'

Input files:
The file 'tagesV3.dat' includes the thermochronometric data used as input for this work and are obtained from the literature.
The files 'trieloffFig5_coreTemp.dat' and 'trieloffFig5_depth17km.dat' include the model of the EL planetesimal that is published in Trieloff et al. Icarus 373, article id. 114762 (2022).

Figure:
- FigS1 is produced by: 'plotTevolV2.py'



